package com.itheima.reggie.mapper;

import com.itheima.reggie.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SetmealDishMapper {
    //添加套餐菜品
     Integer  addSetmealDish(@Param("dishes") List<SetmealDish> setmealDishes);
     //通过setmealId查找指定菜品
    @Select("select * from setmeal_dish where setmeal_id=#{setmealId}")
    List<SetmealDish> findBySetmealId(Long setmealId);
    //添加套餐对应的菜品信息
    Integer updateSetmealDish(List<SetmealDish> setmealDishes);
    //删除套餐对应的菜品信息
    @Delete("delete from setmeal_dish where setmeal_id=#{id}")
    Integer delete(Long id);
}
